package com.ccx.library.module.role.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ccx.library.function.annotation.TimeAt;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName(value = "role")
public class Role {

    @TableId(value = "role_id",type = IdType.ID_WORKER_STR)
    private String roleId;
    @TableField(value = "role_name")
    private String roleName;
    @TableField(value = "role_code")
    private String roleCode;
    @TableField(value = "create_time")
    @TimeAt
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @TableField(value = "role_level")
    private Integer roleLevel;
}
